#ifndef _TIMER_H_
#define _TIMER_H_

#include "type.h"

#define TIMER_MS    1
#define TIMER_S     1000
#define TIMER_100MS 100
typedef enum
{
	TIMER_1S_LOOP,
  TIMER_LED_LOOP,
  TIMER_LED2_OFF_LOOP,
  TIMER_BEEP_LOOP,
  TIMER_TEMP_LOOP,
  TIMER_UPDTA_LOOP,
  TIMER_UPDTA_LOOP_ONE,
  TIMER_MAX30102_CLEAN_LOOP,
	TIMER_UART1_MSG_HANDLE,
	TIMER_UART2_MSG_HANDLE,
  TIMER_UART3_MSG_HANDLE,
  TIMER_AUDIO_WAIT_HANDLE,
	TIMER_NUM,
}TIMER_ENUM;

typedef int (*TIMER_CB)(void);

typedef struct
{
    u8 isStart;
    u32 count;
    TIMER_CB pFun;
} TIMER_STRUCT;

int timer_update_IT(void);
int timer_start(TIMER_ENUM id, u32 period, TIMER_CB pFun);
int timer_stop(TIMER_ENUM id);
int timer_isTimerStart(TIMER_ENUM id);
int timer_isSleep(void);
void Delay_Ms(u32 nTime);
void Delay_Us(u32 nTime);

#endif // !_TIMER_H_

